 <?php
$filename = 'webreport2';
header('Content-type: application/vnd.xls');
header('Content-Disposition: attachment; filename="' . $filename . '.xls"');
?>

<table>
    <tr><td colspan="<?php echo 5+count($yearReport); ?>"  style="text-align: center"><h1 class="blue">Web Report 2</h1></td></tr>
    <tr><td colspan="<?php echo  5+count($yearReport); ?>" style="text-align: center"><h3>Yearly  Statewise Complaint Distribution </h3></td></tr>
    <tr><td colspan="<?php echo  5+count($yearReport); ?>" style="text-align: center"><h4>(As recorded by the National Anti Ragging Help Line)</h4></td></tr>
    <tr><td colspan="<?php echo  5+count($yearReport); ?>"style="text-align: center"><h2>(From June 2009 upto <?php echo date('Y-m-d'); ?></h2></td></tr>
</table>
<table>

    <tr> 
        <td>  State Name </td>
        <?php foreach ($yearReport as $yearReports) { ?>
            <td><?php echo $yearReports->year; ?></td>

        <?php } ?>
        <td>  Total </td>
    </tr>


    <?php foreach ($stateyearReport as $stateyearReports) { ?>
        <tr> 
            <td> <?php echo $stateyearReports->state; ?> </td>

            <?php foreach ($yearReport as $yearReports) { ?>
                <td><?php echo YearReport::countYearwisedate($stateyearReports->state, $yearReports->year); ?> </td>
            <?php } ?>
            <td>  <?php echo YearReport::subtotalreport($stateyearReports->state); ?> </td>
        </tr>
    <?php } ?>
    <tr>
        <td>  Grand Total </td>
        <?php foreach ($yearReport as $yearReports) { ?>
            <td>  <?php echo YearReport::totalCountBYYear($yearReports->year); ?> </td> <?php } ?>
        <td>  <?php echo YearReport::totalReportCount(); ?> </td>
    </tr>

</table>


